<?php  if ( ! defined('CentPHP')) exit( "Disallow to access direct!" );
/*
    |====================================================|
	|  CentPHP                                           |
	|----------------------------------------------------|
	|  package      lib/kernel/Class.View.php             |
	|  auther       Boyu Sun                             |
	|  copyright    Copyright (c) 2008, sunboyu.cn       |
	|  license      freebsd-license                      |
	|  link         www.sunboyu.cn                       |
	|  version      Version 0.1                          |
	|====================================================|
*/

/*
    +-------------------------------------------------------------------
	| class View
	| View class.
	+-------------------------------------------------------------------
*/

class View
{
	public $view_path = '';
	public $_content = '';
	/*
	 *  Constructer
	 *  @param null
	 *  @retrun null
	 */
	function View()
	{
		
	}
	/*
	 *  Load config default
	 *  @param array()
	 *  @retrun null
	 */
	function _init( $config = array() )
	{
		foreach( $config as $key => $value )
		{
			$this->$key = $value;
		}
	}
    /*
	 *  Assign a var into module
	 *  @param array()
	 *  @retrun null
	 */
	function _assign( $_target , $_source )
	{
		$this->$_target = $_source;
	}
	/*
	 *  display a module
	 *  @param array()
	 *  @retrun null
	 */
	function _fetch( $module )
	{
		$this->_content = eval('?>'.file_get_contents($this->view_path."/".$module.'.php'));
	}
    /*
	 *  display a module
	 *  @param array()
	 *  @retrun null
	 */
	function _display( $module )
	{
		echo $this->_fetch( $module );
	}
}

?>